<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="language" content="en" />
        <link href="./assets/ffd55088/css/bootstrap.css" rel="stylesheet">
<link href="./assets/5cf9384a/solarized_light.css" rel="stylesheet">
<link href="./assets/6c54116e/style.css" rel="stylesheet">
<script src="./assets/a44cef0f/jquery.js"></script>
<script src="./assets/ffd55088/js/bootstrap.js"></script>
<script src="./assets/8ac4e28a/jssearch.js"></script>    <title>ActiveRecord, yii\mongodb\ActiveRecord - Yii Framework 2.0 API Documentation</title>
</head>
<body>

<div class="wrap">
    <nav id="w11981" class="navbar-inverse navbar-fixed-top navbar" role="navigation"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#w11981-collapse"><span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span></button><a class="navbar-brand" href="./index.html">Yii Framework 2.0 API Documentation</a></div><div id="w11981-collapse" class="collapse navbar-collapse"><ul id="w11982" class="navbar-nav nav"><li><a href="./index.html">Class reference</a></li>
<li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown">Extensions <b class="caret"></b></a><ul id="w11983" class="dropdown-menu"><li><a href="./ext-apidoc-index.html" tabindex="-1">apidoc</a></li>
<li><a href="./ext-authclient-index.html" tabindex="-1">authclient</a></li>
<li><a href="./ext-bootstrap-index.html" tabindex="-1">bootstrap</a></li>
<li><a href="./ext-codeception-index.html" tabindex="-1">codeception</a></li>
<li><a href="./ext-debug-index.html" tabindex="-1">debug</a></li>
<li><a href="./ext-elasticsearch-index.html" tabindex="-1">elasticsearch</a></li>
<li><a href="./ext-faker-index.html" tabindex="-1">faker</a></li>
<li><a href="./ext-gii-index.html" tabindex="-1">gii</a></li>
<li><a href="./ext-imagine-index.html" tabindex="-1">imagine</a></li>
<li><a href="./ext-jui-index.html" tabindex="-1">jui</a></li>
<li><a href="./ext-mongodb-index.html" tabindex="-1">mongodb</a></li>
<li><a href="./ext-redis-index.html" tabindex="-1">redis</a></li>
<li><a href="./ext-smarty-index.html" tabindex="-1">smarty</a></li>
<li><a href="./ext-sphinx-index.html" tabindex="-1">sphinx</a></li>
<li><a href="./ext-swiftmailer-index.html" tabindex="-1">swiftmailer</a></li>
<li><a href="./ext-twig-index.html" tabindex="-1">twig</a></li></ul></li>
<li><a href="./guide-README.html">Guide</a></li></ul><div class="navbar-form navbar-left" role="search">
  <div class="form-group">
    <input id="searchbox" type="text" class="form-control" placeholder="Search">
  </div>
</div>
</div></nav>
    <div id="search-resultbox" style="display: none;" class="modal-content">
        <ul id="search-results">
        </ul>
    </div>

    
<div class="row">
    <div class="col-md-3">
                <div id="navigation" class="list-group"><a class="list-group-item active" href="#navigation-11972" data-toggle="collapse" data-parent="#navigation">yii\mongodb <b class="caret"></b></a><div id="navigation-11972" class="submenu panel-collapse collapse in"><a class="list-group-item" href="./yii-mongodb-activefixture.html">ActiveFixture</a>
<a class="list-group-item" href="./yii-mongodb-activequery.html">ActiveQuery</a>
<a class="list-group-item active" href="./yii-mongodb-activerecord.html">ActiveRecord</a>
<a class="list-group-item" href="./yii-mongodb-batchqueryresult.html">BatchQueryResult</a>
<a class="list-group-item" href="./yii-mongodb-cache.html">Cache</a>
<a class="list-group-item" href="./yii-mongodb-collection.html">Collection</a>
<a class="list-group-item" href="./yii-mongodb-command.html">Command</a>
<a class="list-group-item" href="./yii-mongodb-connection.html">Connection</a>
<a class="list-group-item" href="./yii-mongodb-database.html">Database</a>
<a class="list-group-item" href="./yii-mongodb-exception.html">Exception</a>
<a class="list-group-item" href="./yii-mongodb-logbuilder.html">LogBuilder</a>
<a class="list-group-item" href="./yii-mongodb-migration.html">Migration</a>
<a class="list-group-item" href="./yii-mongodb-query.html">Query</a>
<a class="list-group-item" href="./yii-mongodb-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-mongodb-session.html">Session</a></div>
<a class="list-group-item" href="#navigation-11973" data-toggle="collapse" data-parent="#navigation">yii\mongodb\console\controllers <b class="caret"></b></a><div id="navigation-11973" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-console-controllers-migratecontroller.html">MigrateController</a></div>
<a class="list-group-item" href="#navigation-11974" data-toggle="collapse" data-parent="#navigation">yii\mongodb\debug <b class="caret"></b></a><div id="navigation-11974" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-debug-explainaction.html">ExplainAction</a>
<a class="list-group-item" href="./yii-mongodb-debug-mongodbpanel.html">MongoDbPanel</a></div>
<a class="list-group-item" href="#navigation-11975" data-toggle="collapse" data-parent="#navigation">yii\mongodb\file <b class="caret"></b></a><div id="navigation-11975" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-file-activequery.html">ActiveQuery</a>
<a class="list-group-item" href="./yii-mongodb-file-activerecord.html">ActiveRecord</a>
<a class="list-group-item" href="./yii-mongodb-file-collection.html">Collection</a>
<a class="list-group-item" href="./yii-mongodb-file-cursor.html">Cursor</a>
<a class="list-group-item" href="./yii-mongodb-file-download.html">Download</a>
<a class="list-group-item" href="./yii-mongodb-file-query.html">Query</a>
<a class="list-group-item" href="./yii-mongodb-file-streamwrapper.html">StreamWrapper</a>
<a class="list-group-item" href="./yii-mongodb-file-upload.html">Upload</a></div>
<a class="list-group-item" href="#navigation-11976" data-toggle="collapse" data-parent="#navigation">yii\mongodb\gii\model <b class="caret"></b></a><div id="navigation-11976" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-gii-model-generator.html">Generator</a></div>
<a class="list-group-item" href="#navigation-11977" data-toggle="collapse" data-parent="#navigation">yii\mongodb\i18n <b class="caret"></b></a><div id="navigation-11977" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-i18n-mongodbmessagesource.html">MongoDbMessageSource</a></div>
<a class="list-group-item" href="#navigation-11978" data-toggle="collapse" data-parent="#navigation">yii\mongodb\log <b class="caret"></b></a><div id="navigation-11978" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-log-mongodbtarget.html">MongoDbTarget</a></div>
<a class="list-group-item" href="#navigation-11979" data-toggle="collapse" data-parent="#navigation">yii\mongodb\rbac <b class="caret"></b></a><div id="navigation-11979" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-rbac-mongodbmanager.html">MongoDbManager</a>
<a class="list-group-item" href="./yii-mongodb-rbac-permission.html">Permission</a>
<a class="list-group-item" href="./yii-mongodb-rbac-role.html">Role</a></div>
<a class="list-group-item" href="#navigation-11980" data-toggle="collapse" data-parent="#navigation">yii\mongodb\validators <b class="caret"></b></a><div id="navigation-11980" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-validators-mongodatevalidator.html">MongoDateValidator</a>
<a class="list-group-item" href="./yii-mongodb-validators-mongoidvalidator.html">MongoIdValidator</a></div></div>    </div>
    <div class="col-md-9 api-content" role="main">
        <h1>Abstract Class yii\mongodb\ActiveRecord</h1>
<div class="top-nav">
    <a href="index.html">All Classes</a>
            | <a href="#properties">Properties</a>
                | <a href="#methods">Methods</a>
                | <a href="#events">Events</a>
                | <a href="#constants">Constants</a>
    </div>

<table class="summaryTable docClass table table-bordered">
    <colgroup>
        <col class="col-name" />
        <col class="col-value" />
    </colgroup>
            <tr><th>Inheritance</th><td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a> &raquo;
<a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a> &raquo;
<a href="yii-base-model.html">yii\base\Model</a> &raquo;
<a href="yii-base-component.html">yii\base\Component</a> &raquo;
<a href="yii-base-object.html">yii\base\Object</a></td></tr>
                <tr><th>Implements</th><td><a href="http://www.php.net/class.arrayaccess">ArrayAccess</a>, <a href="http://www.php.net/class.iteratoraggregate">IteratorAggregate</a>, <a href="yii-base-arrayable.html">yii\base\Arrayable</a>, <a href="yii-base-configurable.html">yii\base\Configurable</a>, <a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td></tr>
                    <tr><th>Uses Traits</th><td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td></tr>
                <tr><th>Subclasses</th><td><a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a></td></tr>
                        <tr><th>Available since version</th><td>2.0</td></tr>
                    <tr>
          <th>Source Code</th>
          <td><a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php">https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php</a></td>
        </tr>
    </table>

<div class="class-description">
    <p><strong>ActiveRecord is the base class for classes representing Mongo documents in terms of objects.</strong></p>
    
    </div>

<a id="properties"></a>

<div class="summary doc-property">
<h2>Public Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-property" />
    <col class="col-type" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
        <tr class="inherited" id="$activeValidators">
        <td><a href="yii-base-model.html#$activeValidators-detail">$activeValidators</a></td>
        <td><a href="yii-validators-validator.html">yii\validators\Validator</a>[]</td>
        <td>The validators applicable to the current <a href="yii-base-model.html#$scenario-detail">$scenario</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$attributes">
        <td><a href="yii-base-model.html#$attributes-detail">$attributes</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>Attribute values (name =&gt; value).</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$behaviors">
        <td><a href="yii-base-component.html#$behaviors-detail">$behaviors</a></td>
        <td><a href="yii-base-behavior.html">yii\base\Behavior</a>[]</td>
        <td>List of behaviors attached to this component</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="$dirtyAttributes">
        <td><a href="yii-db-baseactiverecord.html#$dirtyAttributes-detail">$dirtyAttributes</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>The changed attribute values (name-value pairs)</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="$errors">
        <td><a href="yii-base-model.html#$errors-detail">$errors</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>Errors for all attributes or the specified attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$firstErrors">
        <td><a href="yii-base-model.html#$firstErrors-detail">$firstErrors</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>The first errors.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$isNewRecord">
        <td><a href="yii-db-activerecordinterface.html#$isNewRecord-detail">$isNewRecord</a></td>
        <td><a href="http://www.php.net/language.types.boolean">boolean</a></td>
        <td>Whether the record is new and should be inserted when calling <a href="yii-db-activerecordinterface.html#save()-detail">save()</a>.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="$iterator">
        <td><a href="yii-base-model.html#$iterator-detail">$iterator</a></td>
        <td><a href="http://www.php.net/class.arrayiterator">ArrayIterator</a></td>
        <td>An iterator for traversing the items in the list.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$oldAttributes">
        <td><a href="yii-db-baseactiverecord.html#$oldAttributes-detail">$oldAttributes</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>The old attribute values (name-value pairs)</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="$oldPrimaryKey">
        <td><a href="yii-db-activerecordinterface.html#$oldPrimaryKey-detail">$oldPrimaryKey</a></td>
        <td>mixed</td>
        <td>The old primary key value.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="$primaryKey">
        <td><a href="yii-db-activerecordinterface.html#$primaryKey-detail">$primaryKey</a></td>
        <td>mixed</td>
        <td>The primary key value.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="$relatedRecords">
        <td><a href="yii-db-baseactiverecord.html#$relatedRecords-detail">$relatedRecords</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>An array of related records indexed by relation names.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="$scenario">
        <td><a href="yii-base-model.html#$scenario-detail">$scenario</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>The scenario that this model is in.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$validators">
        <td><a href="yii-base-model.html#$validators-detail">$validators</a></td>
        <td><a href="http://www.php.net/class.arrayobject">ArrayObject</a>|<a href="yii-validators-validator.html">yii\validators\Validator</a>[]</td>
        <td>All the validators declared in the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
    </table>
</div>

<a id="methods"></a>

<div class="summary doc-method">
<h2>Public Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
        <tr class="inherited" id="__call()">
        <td><a href="yii-base-object.html#__call()-detail">__call()</a></td>
        <td>Calls the named method which is not a class method.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__clone()">
        <td><a href="yii-base-component.html#__clone()-detail">__clone()</a></td>
        <td>This method is called after the object is created by cloning an existing one.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="__construct()">
        <td><a href="yii-base-object.html#__construct()-detail">__construct()</a></td>
        <td>Constructor.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__get()">
        <td><a href="yii-db-baseactiverecord.html#__get()-detail">__get()</a></td>
        <td>PHP getter magic method.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="__isset()">
        <td><a href="yii-db-baseactiverecord.html#__isset()-detail">__isset()</a></td>
        <td>Checks if a property value is null.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="__set()">
        <td><a href="yii-db-baseactiverecord.html#__set()-detail">__set()</a></td>
        <td>PHP setter magic method.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="__unset()">
        <td><a href="yii-db-baseactiverecord.html#__unset()-detail">__unset()</a></td>
        <td>Sets a component property to be null.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="activeAttributes()">
        <td><a href="yii-base-model.html#activeAttributes()-detail">activeAttributes()</a></td>
        <td>Returns the attribute names that are subject to validation in the current scenario.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="addError()">
        <td><a href="yii-base-model.html#addError()-detail">addError()</a></td>
        <td>Adds a new error to the specified attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="addErrors()">
        <td><a href="yii-base-model.html#addErrors()-detail">addErrors()</a></td>
        <td>Adds a list of errors.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="afterDelete()">
        <td><a href="yii-db-baseactiverecord.html#afterDelete()-detail">afterDelete()</a></td>
        <td>This method is invoked after deleting a record.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="afterFind()">
        <td><a href="yii-db-baseactiverecord.html#afterFind()-detail">afterFind()</a></td>
        <td>This method is called when the AR object is created and populated with the query result.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="afterRefresh()">
        <td><a href="yii-db-baseactiverecord.html#afterRefresh()-detail">afterRefresh()</a></td>
        <td>This method is called when the AR object is refreshed.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="afterSave()">
        <td><a href="yii-db-baseactiverecord.html#afterSave()-detail">afterSave()</a></td>
        <td>This method is called at the end of inserting or updating a record.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="afterValidate()">
        <td><a href="yii-base-model.html#afterValidate()-detail">afterValidate()</a></td>
        <td>This method is invoked after validation ends.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="attachBehavior()">
        <td><a href="yii-base-component.html#attachBehavior()-detail">attachBehavior()</a></td>
        <td>Attaches a behavior to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="attachBehaviors()">
        <td><a href="yii-base-component.html#attachBehaviors()-detail">attachBehaviors()</a></td>
        <td>Attaches a list of behaviors to the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="attributeHints()">
        <td><a href="yii-base-model.html#attributeHints()-detail">attributeHints()</a></td>
        <td>Returns the attribute hints.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="attributeLabels()">
        <td><a href="yii-base-model.html#attributeLabels()-detail">attributeLabels()</a></td>
        <td>Returns the attribute labels.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="attributes()">
        <td><a href="yii-mongodb-activerecord.html#attributes()-detail">attributes()</a></td>
        <td>Returns the list of all attribute names of the model.</td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="beforeDelete()">
        <td><a href="yii-db-baseactiverecord.html#beforeDelete()-detail">beforeDelete()</a></td>
        <td>This method is invoked before deleting a record.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="beforeSave()">
        <td><a href="yii-db-baseactiverecord.html#beforeSave()-detail">beforeSave()</a></td>
        <td>This method is called at the beginning of inserting or updating a record.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="beforeValidate()">
        <td><a href="yii-base-model.html#beforeValidate()-detail">beforeValidate()</a></td>
        <td>This method is invoked before validation starts.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="behaviors()">
        <td><a href="yii-base-component.html#behaviors()-detail">behaviors()</a></td>
        <td>Returns a list of behaviors that this component should behave as.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="canGetProperty()">
        <td><a href="yii-base-object.html#canGetProperty()-detail">canGetProperty()</a></td>
        <td>Returns a value indicating whether a property can be read.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="canSetProperty()">
        <td><a href="yii-base-object.html#canSetProperty()-detail">canSetProperty()</a></td>
        <td>Returns a value indicating whether a property can be set.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="className()">
        <td><a href="yii-base-object.html#className()-detail">className()</a></td>
        <td>Returns the fully qualified name of this class.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="clearErrors()">
        <td><a href="yii-base-model.html#clearErrors()-detail">clearErrors()</a></td>
        <td>Removes errors for all attributes or a single attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="collectionName()">
        <td><a href="yii-mongodb-activerecord.html#collectionName()-detail">collectionName()</a></td>
        <td>Declares the name of the Mongo collection associated with this AR class.</td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="createValidators()">
        <td><a href="yii-base-model.html#createValidators()-detail">createValidators()</a></td>
        <td>Creates validator objects based on the validation rules specified in <a href="yii-base-model.html#rules()-detail">rules()</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="delete()">
        <td><a href="yii-mongodb-activerecord.html#delete()-detail">delete()</a></td>
        <td>Deletes the document corresponding to this active record from the collection.</td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
            <tr id="deleteAll()">
        <td><a href="yii-mongodb-activerecord.html#deleteAll()-detail">deleteAll()</a></td>
        <td>Deletes documents in the collection using the provided conditions.</td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
                <tr class="inherited" id="detachBehavior()">
        <td><a href="yii-base-component.html#detachBehavior()-detail">detachBehavior()</a></td>
        <td>Detaches a behavior from the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="detachBehaviors()">
        <td><a href="yii-base-component.html#detachBehaviors()-detail">detachBehaviors()</a></td>
        <td>Detaches all behaviors from the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="ensureBehaviors()">
        <td><a href="yii-base-component.html#ensureBehaviors()-detail">ensureBehaviors()</a></td>
        <td>Makes sure that the behaviors declared in <a href="yii-base-component.html#behaviors()-detail">behaviors()</a> are attached to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="equals()">
        <td><a href="yii-mongodb-activerecord.html#equals()-detail">equals()</a></td>
        <td>Returns a value indicating whether the given active record is the same as the current one.</td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="extraFields()">
        <td><a href="yii-base-arrayabletrait.html#extraFields()-detail">extraFields()</a></td>
        <td>Returns the list of fields that can be expanded further and returned by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a>.</td>
        <td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td>
    </tr>
            <tr class="inherited" id="fields()">
        <td><a href="yii-base-arrayabletrait.html#fields()-detail">fields()</a></td>
        <td>Returns the list of fields that should be returned by default by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a> when no specific fields are specified.</td>
        <td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td>
    </tr>
            <tr id="find()">
        <td><a href="yii-mongodb-activerecord.html#find()-detail">find()</a></td>
        <td>Creates an <span class="broken-link">\yii\mongodb\ActiveQueryInterface</span> instance for query purpose.</td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="findAll()">
        <td><a href="yii-db-activerecordinterface.html#findAll()-detail">findAll()</a></td>
        <td>Returns a list of active record models that match the specified primary key value(s) or a set of column values.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
                <tr class="inherited" id="findOne()">
        <td><a href="yii-db-activerecordinterface.html#findOne()-detail">findOne()</a></td>
        <td>Returns a single active record model instance by a primary key or an array of column values.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="formName()">
        <td><a href="yii-base-model.html#formName()-detail">formName()</a></td>
        <td>Returns the form name that this model class should use.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="generateAttributeLabel()">
        <td><a href="yii-base-model.html#generateAttributeLabel()-detail">generateAttributeLabel()</a></td>
        <td>Generates a user friendly attribute label based on the give attribute name.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getActiveValidators()">
        <td><a href="yii-base-model.html#getActiveValidators()-detail">getActiveValidators()</a></td>
        <td>Returns the validators applicable to the current <a href="yii-base-model.html#$scenario-detail">$scenario</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getAttribute()">
        <td><a href="yii-db-activerecordinterface.html#getAttribute()-detail">getAttribute()</a></td>
        <td>Returns the named attribute value.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="getAttributeHint()">
        <td><a href="yii-db-baseactiverecord.html#getAttributeHint()-detail">getAttributeHint()</a></td>
        <td>Returns the text hint for the specified attribute.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getAttributeLabel()">
        <td><a href="yii-db-baseactiverecord.html#getAttributeLabel()-detail">getAttributeLabel()</a></td>
        <td>Returns the text label for the specified attribute.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getAttributes()">
        <td><a href="yii-base-model.html#getAttributes()-detail">getAttributes()</a></td>
        <td>Returns attribute values.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getBehavior()">
        <td><a href="yii-base-component.html#getBehavior()-detail">getBehavior()</a></td>
        <td>Returns the named behavior object.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="getBehaviors()">
        <td><a href="yii-base-component.html#getBehaviors()-detail">getBehaviors()</a></td>
        <td>Returns all behaviors attached to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="getCollection()">
        <td><a href="yii-mongodb-activerecord.html#getCollection()-detail">getCollection()</a></td>
        <td>Return the Mongo collection instance for this AR class.</td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
            <tr id="getDb()">
        <td><a href="yii-mongodb-activerecord.html#getDb()-detail">getDb()</a></td>
        <td>Returns the Mongo connection used by this AR class.</td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getDirtyAttributes()">
        <td><a href="yii-db-baseactiverecord.html#getDirtyAttributes()-detail">getDirtyAttributes()</a></td>
        <td>Returns the attribute values that have been modified since they are loaded or saved most recently.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getErrors()">
        <td><a href="yii-base-model.html#getErrors()-detail">getErrors()</a></td>
        <td>Returns the errors for all attribute or a single attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getFirstError()">
        <td><a href="yii-base-model.html#getFirstError()-detail">getFirstError()</a></td>
        <td>Returns the first error of the specified attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getFirstErrors()">
        <td><a href="yii-base-model.html#getFirstErrors()-detail">getFirstErrors()</a></td>
        <td>Returns the first error of every attribute in the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getIsNewRecord()">
        <td><a href="yii-db-activerecordinterface.html#getIsNewRecord()-detail">getIsNewRecord()</a></td>
        <td>Returns a value indicating whether the current record is new (not saved in the database).</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="getIterator()">
        <td><a href="yii-base-model.html#getIterator()-detail">getIterator()</a></td>
        <td>Returns an iterator for traversing the attributes in the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getOldAttribute()">
        <td><a href="yii-db-baseactiverecord.html#getOldAttribute()-detail">getOldAttribute()</a></td>
        <td>Returns the old value of the named attribute.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getOldAttributes()">
        <td><a href="yii-db-baseactiverecord.html#getOldAttributes()-detail">getOldAttributes()</a></td>
        <td>Returns the old attribute values.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getOldPrimaryKey()">
        <td><a href="yii-db-activerecordinterface.html#getOldPrimaryKey()-detail">getOldPrimaryKey()</a></td>
        <td>Returns the old primary key value(s).</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="getPrimaryKey()">
        <td><a href="yii-db-activerecordinterface.html#getPrimaryKey()-detail">getPrimaryKey()</a></td>
        <td>Returns the primary key value(s).</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="getRelatedRecords()">
        <td><a href="yii-db-baseactiverecord.html#getRelatedRecords()-detail">getRelatedRecords()</a></td>
        <td>Returns all populated related records.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getRelation()">
        <td><a href="yii-db-activerecordinterface.html#getRelation()-detail">getRelation()</a></td>
        <td>Returns the relation object with the specified name.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="getScenario()">
        <td><a href="yii-base-model.html#getScenario()-detail">getScenario()</a></td>
        <td>Returns the scenario that this model is used in.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getValidators()">
        <td><a href="yii-base-model.html#getValidators()-detail">getValidators()</a></td>
        <td>Returns all the validators declared in <a href="yii-base-model.html#rules()-detail">rules()</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="hasAttribute()">
        <td><a href="yii-db-activerecordinterface.html#hasAttribute()-detail">hasAttribute()</a></td>
        <td>Returns a value indicating whether the record has an attribute with the specified name.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="hasErrors()">
        <td><a href="yii-base-model.html#hasErrors()-detail">hasErrors()</a></td>
        <td>Returns a value indicating whether there is any validation error.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="hasEventHandlers()">
        <td><a href="yii-base-component.html#hasEventHandlers()-detail">hasEventHandlers()</a></td>
        <td>Returns a value indicating whether there is any handler attached to the named event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="hasMany()">
        <td><a href="yii-db-baseactiverecord.html#hasMany()-detail">hasMany()</a></td>
        <td>Declares a <code>has-many</code> relation.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="hasMethod()">
        <td><a href="yii-base-object.html#hasMethod()-detail">hasMethod()</a></td>
        <td>Returns a value indicating whether a method is defined.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="hasOne()">
        <td><a href="yii-db-baseactiverecord.html#hasOne()-detail">hasOne()</a></td>
        <td>Declares a <code>has-one</code> relation.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="hasProperty()">
        <td><a href="yii-base-object.html#hasProperty()-detail">hasProperty()</a></td>
        <td>Returns a value indicating whether a property is defined.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="init()">
        <td><a href="yii-db-baseactiverecord.html#init()-detail">init()</a></td>
        <td>Initializes the object.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="insert()">
        <td><a href="yii-mongodb-activerecord.html#insert()-detail">insert()</a></td>
        <td>Inserts a row into the associated Mongo collection using the attribute values of this record.</td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
                <tr class="inherited" id="instantiate()">
        <td><a href="yii-db-baseactiverecord.html#instantiate()-detail">instantiate()</a></td>
        <td>Creates an active record instance.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="isAttributeActive()">
        <td><a href="yii-base-model.html#isAttributeActive()-detail">isAttributeActive()</a></td>
        <td>Returns a value indicating whether the attribute is active in the current scenario.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="isAttributeChanged()">
        <td><a href="yii-db-baseactiverecord.html#isAttributeChanged()-detail">isAttributeChanged()</a></td>
        <td>Returns a value indicating whether the named attribute has been changed.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="isAttributeRequired()">
        <td><a href="yii-base-model.html#isAttributeRequired()-detail">isAttributeRequired()</a></td>
        <td>Returns a value indicating whether the attribute is required.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="isAttributeSafe()">
        <td><a href="yii-base-model.html#isAttributeSafe()-detail">isAttributeSafe()</a></td>
        <td>Returns a value indicating whether the attribute is safe for massive assignments.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="isPrimaryKey()">
        <td><a href="yii-db-activerecordinterface.html#isPrimaryKey()-detail">isPrimaryKey()</a></td>
        <td>Returns a value indicating whether the given set of attributes represents the primary key for this model</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="isRelationPopulated()">
        <td><a href="yii-db-baseactiverecord.html#isRelationPopulated()-detail">isRelationPopulated()</a></td>
        <td>Check whether the named relation has been populated with records.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="link()">
        <td><a href="yii-db-activerecordinterface.html#link()-detail">link()</a></td>
        <td>Establishes the relationship between two records.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="load()">
        <td><a href="yii-base-model.html#load()-detail">load()</a></td>
        <td>Populates the model with input data.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="loadMultiple()">
        <td><a href="yii-base-model.html#loadMultiple()-detail">loadMultiple()</a></td>
        <td>Populates a set of models with the data from end user.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="markAttributeDirty()">
        <td><a href="yii-db-baseactiverecord.html#markAttributeDirty()-detail">markAttributeDirty()</a></td>
        <td>Marks an attribute dirty.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="off()">
        <td><a href="yii-base-component.html#off()-detail">off()</a></td>
        <td>Detaches an existing event handler from this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="offsetExists()">
        <td><a href="yii-db-baseactiverecord.html#offsetExists()-detail">offsetExists()</a></td>
        <td>Returns whether there is an element at the specified offset.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="offsetGet()">
        <td><a href="yii-base-model.html#offsetGet()-detail">offsetGet()</a></td>
        <td>Returns the element at the specified offset.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="offsetSet()">
        <td><a href="yii-base-model.html#offsetSet()-detail">offsetSet()</a></td>
        <td>Sets the element at the specified offset.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="offsetUnset()">
        <td><a href="yii-db-baseactiverecord.html#offsetUnset()-detail">offsetUnset()</a></td>
        <td>Sets the element value at the specified offset to null.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="on()">
        <td><a href="yii-base-component.html#on()-detail">on()</a></td>
        <td>Attaches an event handler to an event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="onUnsafeAttribute()">
        <td><a href="yii-base-model.html#onUnsafeAttribute()-detail">onUnsafeAttribute()</a></td>
        <td>This method is invoked when an unsafe attribute is being massively assigned.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="optimisticLock()">
        <td><a href="yii-db-baseactiverecord.html#optimisticLock()-detail">optimisticLock()</a></td>
        <td>Returns the name of the column that stores the lock version for implementing optimistic locking.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="populateRecord()">
        <td><a href="yii-db-baseactiverecord.html#populateRecord()-detail">populateRecord()</a></td>
        <td>Populates an active record object using a row of data from the database/storage.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="populateRelation()">
        <td><a href="yii-db-activerecordinterface.html#populateRelation()-detail">populateRelation()</a></td>
        <td>Populates the named relation with the related records.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr id="primaryKey()">
        <td><a href="yii-mongodb-activerecord.html#primaryKey()-detail">primaryKey()</a></td>
        <td>Returns the primary key name(s) for this AR class.</td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="refresh()">
        <td><a href="yii-db-baseactiverecord.html#refresh()-detail">refresh()</a></td>
        <td>Repopulates this active record with the latest data.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
                <tr class="inherited" id="rules()">
        <td><a href="yii-base-model.html#rules()-detail">rules()</a></td>
        <td>Returns the validation rules for attributes.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="safeAttributes()">
        <td><a href="yii-base-model.html#safeAttributes()-detail">safeAttributes()</a></td>
        <td>Returns the attribute names that are safe to be massively assigned in the current scenario.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="save()">
        <td><a href="yii-db-activerecordinterface.html#save()-detail">save()</a></td>
        <td>Saves the current record.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="scenarios()">
        <td><a href="yii-base-model.html#scenarios()-detail">scenarios()</a></td>
        <td>Returns a list of scenarios and the corresponding active attributes.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="setAttribute()">
        <td><a href="yii-db-activerecordinterface.html#setAttribute()-detail">setAttribute()</a></td>
        <td>Sets the named attribute value.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="setAttributes()">
        <td><a href="yii-base-model.html#setAttributes()-detail">setAttributes()</a></td>
        <td>Sets the attribute values in a massive way.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="setIsNewRecord()">
        <td><a href="yii-db-baseactiverecord.html#setIsNewRecord()-detail">setIsNewRecord()</a></td>
        <td>Sets the value indicating whether the record is new.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="setOldAttribute()">
        <td><a href="yii-db-baseactiverecord.html#setOldAttribute()-detail">setOldAttribute()</a></td>
        <td>Sets the old value of the named attribute.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="setOldAttributes()">
        <td><a href="yii-db-baseactiverecord.html#setOldAttributes()-detail">setOldAttributes()</a></td>
        <td>Sets the old attribute values.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="setScenario()">
        <td><a href="yii-base-model.html#setScenario()-detail">setScenario()</a></td>
        <td>Sets the scenario for the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="toArray()">
        <td><a href="yii-mongodb-activerecord.html#toArray()-detail">toArray()</a></td>
        <td>Converts the model into an array.</td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="trigger()">
        <td><a href="yii-base-component.html#trigger()-detail">trigger()</a></td>
        <td>Triggers an event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="unlink()">
        <td><a href="yii-db-activerecordinterface.html#unlink()-detail">unlink()</a></td>
        <td>Destroys the relationship between two records.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="unlinkAll()">
        <td><a href="yii-db-baseactiverecord.html#unlinkAll()-detail">unlinkAll()</a></td>
        <td>Destroys the relationship in current model.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="update()">
        <td><a href="yii-db-activerecordinterface.html#update()-detail">update()</a></td>
        <td>Saves the changes to this active record into the database.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr id="updateAll()">
        <td><a href="yii-mongodb-activerecord.html#updateAll()-detail">updateAll()</a></td>
        <td>Updates all documents in the collection using the provided attribute values and conditions.</td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
            <tr id="updateAllCounters()">
        <td><a href="yii-mongodb-activerecord.html#updateAllCounters()-detail">updateAllCounters()</a></td>
        <td>Updates all documents in the collection using the provided counter changes and conditions.</td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="updateAttributes()">
        <td><a href="yii-db-baseactiverecord.html#updateAttributes()-detail">updateAttributes()</a></td>
        <td>Updates the specified attributes.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="updateCounters()">
        <td><a href="yii-db-baseactiverecord.html#updateCounters()-detail">updateCounters()</a></td>
        <td>Updates one or several counter columns for the current AR object.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
                <tr class="inherited" id="validate()">
        <td><a href="yii-base-model.html#validate()-detail">validate()</a></td>
        <td>Performs the data validation.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="validateMultiple()">
        <td><a href="yii-base-model.html#validateMultiple()-detail">validateMultiple()</a></td>
        <td>Validates multiple models.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
    </table>
</div>

<div class="summary doc-method">
<h2>Protected Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
                                                                                                                                        <tr id="deleteInternal()">
        <td><a href="yii-mongodb-activerecord.html#deleteInternal()-detail">deleteInternal()</a></td>
        <td></td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
                                            <tr class="inherited" id="findByCondition()">
        <td><a href="yii-db-baseactiverecord.html#findByCondition()-detail">findByCondition()</a></td>
        <td>Finds ActiveRecord instance(s) by the given condition.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
                                                                                                                                                        <tr id="insertInternal()">
        <td><a href="yii-mongodb-activerecord.html#insertInternal()-detail">insertInternal()</a></td>
        <td></td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
                                                                                                        <tr class="inherited" id="resolveFields()">
        <td><a href="yii-base-arrayabletrait.html#resolveFields()-detail">resolveFields()</a></td>
        <td>Determines which fields can be returned by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a>.</td>
        <td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td>
    </tr>
                                                                                        <tr id="updateInternal()">
        <td><a href="yii-mongodb-activerecord.html#updateInternal()-detail">updateInternal()</a></td>
        <td></td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
            </table>
</div>

<a id="events"></a>
<div class="summary doc-event">
    <h2>Events</h2>

    <p><a href="#" class="toggle">Hide inherited events</a></p>

    <table class="summary-table table table-striped table-bordered table-hover">
    <colgroup>
        <col class="col-event" />
        <col class="col-type" />
        <col class="col-description" />
        <col class="col-defined" />
    </colgroup>
    <tr>
        <th>Event</th><th>Type</th><th>Description</th><th>Defined By</th>
    </tr>
        <tr class="inherited" id="EVENT_AFTER_DELETE">
        <td><a href="yii-db-baseactiverecord.html#EVENT_AFTER_DELETE-detail">EVENT_AFTER_DELETE</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event that is triggered after a record is deleted.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_AFTER_FIND">
        <td><a href="yii-db-baseactiverecord.html#EVENT_AFTER_FIND-detail">EVENT_AFTER_FIND</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event that is triggered after the record is created and populated with query result.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_AFTER_INSERT">
        <td><a href="yii-db-baseactiverecord.html#EVENT_AFTER_INSERT-detail">EVENT_AFTER_INSERT</a></td>
        <td><a href="yii-db-aftersaveevent.html">yii\db\AfterSaveEvent</a></td>
        <td>
            An event that is triggered after a record is inserted.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_AFTER_REFRESH">
        <td><a href="yii-db-baseactiverecord.html#EVENT_AFTER_REFRESH-detail">EVENT_AFTER_REFRESH</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event that is triggered after a record is refreshed.                            (available since version 2.0.8)
                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_AFTER_UPDATE">
        <td><a href="yii-db-baseactiverecord.html#EVENT_AFTER_UPDATE-detail">EVENT_AFTER_UPDATE</a></td>
        <td><a href="yii-db-aftersaveevent.html">yii\db\AfterSaveEvent</a></td>
        <td>
            An event that is triggered after a record is updated.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_AFTER_VALIDATE">
        <td><a href="yii-base-model.html#EVENT_AFTER_VALIDATE-detail">EVENT_AFTER_VALIDATE</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event raised at the end of <a href="yii-base-model.html#validate()-detail">validate()</a>                    </td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
        <tr class="inherited" id="EVENT_BEFORE_DELETE">
        <td><a href="yii-db-baseactiverecord.html#EVENT_BEFORE_DELETE-detail">EVENT_BEFORE_DELETE</a></td>
        <td><a href="yii-base-modelevent.html">yii\base\ModelEvent</a></td>
        <td>
            An event that is triggered before deleting a record.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_BEFORE_INSERT">
        <td><a href="yii-db-baseactiverecord.html#EVENT_BEFORE_INSERT-detail">EVENT_BEFORE_INSERT</a></td>
        <td><a href="yii-base-modelevent.html">yii\base\ModelEvent</a></td>
        <td>
            An event that is triggered before inserting a record.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_BEFORE_UPDATE">
        <td><a href="yii-db-baseactiverecord.html#EVENT_BEFORE_UPDATE-detail">EVENT_BEFORE_UPDATE</a></td>
        <td><a href="yii-base-modelevent.html">yii\base\ModelEvent</a></td>
        <td>
            An event that is triggered before updating a record.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_BEFORE_VALIDATE">
        <td><a href="yii-base-model.html#EVENT_BEFORE_VALIDATE-detail">EVENT_BEFORE_VALIDATE</a></td>
        <td><a href="yii-base-modelevent.html">yii\base\ModelEvent</a></td>
        <td>
            An event raised at the beginning of <a href="yii-base-model.html#validate()-detail">validate()</a>.                    </td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
        <tr class="inherited" id="EVENT_INIT">
        <td><a href="yii-db-baseactiverecord.html#EVENT_INIT-detail">EVENT_INIT</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event that is triggered when the record is initialized via <a href="yii-db-baseactiverecord.html#init()-detail">init()</a>.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        </table>
</div>

<a id="constants"></a>
<div class="summary doc-const">
    <h2>Constants</h2>

    <p><a href="#" class="toggle">Hide inherited constants</a></p>

    <table class="summary-table table table-striped table-bordered table-hover">
    <colgroup>
        <col class="col-const" />
        <col class="col-value" />
        <col class="col-description" />
        <col class="col-defined" />
    </colgroup>
    <tr>
        <th>Constant</th><th>Value</th><th>Description</th><th>Defined By</th>
    </tr>
            <tr class="inherited" id="SCENARIO_DEFAULT">
          <td id="SCENARIO_DEFAULT-detail">SCENARIO_DEFAULT</td>
          <td>'default'</td>
          <td>The name of the default scenario.
</td>
          <td><a href="yii-base-model.html">yii\base\Model</a></td>
        </tr>
        </table>
</div>

<h2>Method Details</h2>

<div class="method-doc">

    <div class="detail-header h3" id="attributes()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#attributes()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L163" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L163" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        attributes()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the list of all attribute names of the model.</strong></p>

        <p>This method must be overridden by child classes to define available attributes.
Note: primary key attribute "_id" should be always present in returned array.
For example:</p>
<pre><code class="hljs php language-php"><span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">attributes</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-keyword">return</span> [<span class="hljs-string">'_id'</span>, <span class="hljs-string">'name'</span>, <span class="hljs-string">'address'</span>, <span class="hljs-string">'status'</span>];
}
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-mongodb-activerecord.html#attributes()-detail">attributes</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of attribute names.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidconfigexception.html">yii\base\InvalidConfigException</a></td>
                  <td class="param-desc-col"><p>if not implemented</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="collectionName()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#collectionName()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L120" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L120" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        collectionName()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Declares the name of the Mongo collection associated with this AR class.</strong></p>

        <p>Collection name can be either a string or array:</p>
<ul>
<li>if string considered as the name of the collection inside the default database.</li>
<li>if array - first element considered as the name of the database, second - as
name of collection inside that database</li>
</ul>
<p>By default this method returns the class name as the collection name by calling <a href="yii-helpers-baseinflector.html#camel2id()-detail">yii\helpers\Inflector::camel2id()</a>.
For example, 'Customer' becomes 'customer', and 'OrderItem' becomes
'order_item'. You may override this method if the collection is not named after this convention.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-mongodb-activerecord.html#collectionName()-detail">collectionName</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The collection name</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="delete()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#delete()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L307" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L307" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        delete()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Deletes the document corresponding to this active record from the collection.</strong></p>

        <p>This method performs the following steps in order:</p>
<ol>
<li>call <a href="yii-db-baseactiverecord.html#beforeDelete()-detail">beforeDelete()</a>. If the method returns false, it will skip the
rest of the steps;</li>
<li>delete the document from the collection;</li>
<li>call <a href="yii-db-baseactiverecord.html#afterDelete()-detail">afterDelete()</a>.</li>
</ol>
<p>In the above step 1 and 3, events named <a href="yii-db-baseactiverecord.html#EVENT_BEFORE_DELETE-detail">EVENT_BEFORE_DELETE</a> and <a href="yii-db-baseactiverecord.html#EVENT_AFTER_DELETE-detail">EVENT_AFTER_DELETE</a>
will be raised by the corresponding methods.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.integer">integer</a>|<a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-mongodb-activerecord.html#delete()-detail">delete</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a>|<a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>The number of documents deleted, or false if the deletion is unsuccessful for some reason.
Note that it is possible the number of documents deleted is 0, even though the deletion execution is successful.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-db-staleobjectexception.html">yii\db\StaleObjectException</a></td>
                  <td class="param-desc-col"><p>if <a href="yii-db-baseactiverecord.html#optimisticLock()-detail">optimistic locking</a> is enabled and the data
being deleted is outdated.</p>
</td>
                </tr>
                            <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="http://www.php.net/class.exception">Exception</a></td>
                  <td class="param-desc-col"><p>in case delete failed.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="deleteAll()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#deleteAll()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L93" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L93" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        deleteAll()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Deletes documents in the collection using the provided conditions.</strong></p>

        <p>WARNING: If you do not specify any condition, this method will delete documents rows in the collection.</p>
<p>For example, to delete all customers whose status is 3:</p>
<pre><code class="hljs php language-php">Customer::deleteAll([<span class="hljs-string">'status'</span> =&gt; <span class="hljs-number">3</span>]);
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="http://www.php.net/language.types.integer">integer</a></span> <strong><a href="yii-mongodb-activerecord.html#deleteAll()-detail">deleteAll</a></strong> ( <span style="color: #0000BB">$condition&nbsp;</span><span style="color: #007700">=&nbsp;[]</span>, <span style="color: #0000BB">$options&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$condition</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Description of the objects to delete.
Please refer to <a href="yii-db-querytrait.html#where()-detail">yii\mongodb\Query::where()</a> on how to specify this parameter.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$options</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of options in format: optionName =&gt; optionValue.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>The number of documents deleted.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="deleteInternal()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#deleteInternal()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L322" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L322" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        deleteInternal()
        <span class="detail-header-tag small">
            protected                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong></strong></p>

        
        <p>See also <a href="yii-mongodb-activerecord.html#delete()-detail">yii\mongodb\ActiveRecord::delete()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">protected</span> <span class="signature-type">void</span> <strong><a href="yii-mongodb-activerecord.html#deleteInternal()-detail">deleteInternal</a></strong> ( )</td></tr>
                                                            <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-db-staleobjectexception.html">yii\db\StaleObjectException</a></td>
                  <td class="param-desc-col"></td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="equals()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#equals()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L347" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L347" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        equals()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns a value indicating whether the given active record is the same as the current one.</strong></p>

        <p>The comparison is made by comparing the collection names and the primary key values of the two active records.
If one of the records <a href="yii-db-activerecordinterface.html#$isNewRecord-detail">is new</a> they are also considered not equal.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-mongodb-activerecord.html#equals()-detail">equals</a></strong> ( <span style="color: #0000BB">$record</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$record</span></td>
                  <td class="param-type-col"><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
                  <td class="param-desc-col"><p>Record to compare to</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the two active records refer to the same row in the same Mongo collection.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="find()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#find()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L102" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L102" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        find()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Creates an <span class="broken-link">\yii\mongodb\ActiveQueryInterface</span> instance for query purpose.</strong></p>

        <p>The returned <span class="broken-link">\yii\mongodb\ActiveQueryInterface</span> instance can be further customized by calling
methods defined in <span class="broken-link">\yii\mongodb\ActiveQueryInterface</span> before <code>one()</code> or <code>all()</code> is called to return
populated ActiveRecord instances. For example,</p>
<pre><code class="hljs php language-php"><span class="hljs-comment">// find the customer whose ID is 1</span>
<span class="hljs-variable">$customer</span> = Customer::find()-&gt;where([<span class="hljs-string">'id'</span> =&gt; <span class="hljs-number">1</span>])-&gt;one();

<span class="hljs-comment">// find all active customers and order them by their age:</span>
<span class="hljs-variable">$customers</span> = Customer::find()
    -&gt;where([<span class="hljs-string">'status'</span> =&gt; <span class="hljs-number">1</span>])
    -&gt;orderBy(<span class="hljs-string">'age'</span>)
    -&gt;all();
</code></pre>
<p>This method is also called by <a href="yii-db-baseactiverecord.html#hasOne()-detail">yii\db\BaseActiveRecord::hasOne()</a> and <a href="yii-db-baseactiverecord.html#hasMany()-detail">yii\db\BaseActiveRecord::hasMany()</a> to
create a relational query.</p>
<p>You may override this method to return a customized query. For example,</p>
<pre><code class="hljs php language-php"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Customer</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">ActiveRecord</span>
</span>{
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">find</span><span class="hljs-params">()</span>
    </span>{
        <span class="hljs-comment">// use CustomerQuery instead of the default ActiveQuery</span>
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> CustomerQuery(get_called_class());
    }
}
</code></pre>
<p>The following code shows how to apply a default condition for all queries:</p>
<pre><code class="hljs php language-php"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Customer</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">ActiveRecord</span>
</span>{
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">find</span><span class="hljs-params">()</span>
    </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">parent</span>::find()-&gt;where([<span class="hljs-string">'deleted'</span> =&gt; <span class="hljs-keyword">false</span>]);
    }
}

<span class="hljs-comment">// Use andWhere()/orWhere() to apply the default condition</span>
<span class="hljs-comment">// SELECT FROM customer WHERE `deleted`=:deleted AND age&gt;30</span>
<span class="hljs-variable">$customers</span> = Customer::find()-&gt;andWhere(<span class="hljs-string">'age&gt;30'</span>)-&gt;all();

<span class="hljs-comment">// Use where() to ignore the default condition</span>
<span class="hljs-comment">// SELECT FROM customer WHERE age&gt;30</span>
<span class="hljs-variable">$customers</span> = Customer::find()-&gt;where(<span class="hljs-string">'age&gt;30'</span>)-&gt;all();


</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="yii-mongodb-activequery.html">yii\mongodb\ActiveQuery</a></span> <strong><a href="yii-mongodb-activerecord.html#find()-detail">find</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-mongodb-activequery.html">yii\mongodb\ActiveQuery</a></td>
                  <td class="param-desc-col"><p>The newly created <a href="yii-mongodb-activequery.html">yii\mongodb\ActiveQuery</a> instance.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getCollection()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#getCollection()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L129" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L129" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getCollection()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Return the Mongo collection instance for this AR class.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></span> <strong><a href="yii-mongodb-activerecord.html#getCollection()-detail">getCollection</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
                  <td class="param-desc-col"><p>Collection instance.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getDb()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#getDb()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L34" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L34" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getDb()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the Mongo connection used by this AR class.</strong></p>

        <p>By default, the "mongodb" application component is used as the Mongo connection.
You may override this method if you want to use a different database connection.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="yii-mongodb-connection.html">yii\mongodb\Connection</a></span> <strong><a href="yii-mongodb-activerecord.html#getDb()-detail">getDb</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-mongodb-connection.html">yii\mongodb\Connection</a></td>
                  <td class="param-desc-col"><p>The database connection used by this AR class.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="insert()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#insert()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L206" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L206" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        insert()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Inserts a row into the associated Mongo collection using the attribute values of this record.</strong></p>

        <p>This method performs the following steps in order:</p>
<ol>
<li>call <a href="yii-base-model.html#beforeValidate()-detail">beforeValidate()</a> when <code>$runValidation</code> is true. If validation
fails, it will skip the rest of the steps;</li>
<li>call <a href="yii-base-model.html#afterValidate()-detail">afterValidate()</a> when <code>$runValidation</code> is true.</li>
<li>call <a href="yii-db-baseactiverecord.html#beforeSave()-detail">beforeSave()</a>. If the method returns false, it will skip the
rest of the steps;</li>
<li>insert the record into collection. If this fails, it will skip the rest of the steps;</li>
<li>call <a href="yii-db-baseactiverecord.html#afterSave()-detail">afterSave()</a>;</li>
</ol>
<p>In the above step 1, 2, 3 and 5, events <a href="yii-base-model.html#EVENT_BEFORE_VALIDATE-detail">EVENT_BEFORE_VALIDATE</a>,
<a href="yii-db-baseactiverecord.html#EVENT_BEFORE_INSERT-detail">EVENT_BEFORE_INSERT</a>, <a href="yii-db-baseactiverecord.html#EVENT_AFTER_INSERT-detail">EVENT_AFTER_INSERT</a> and <a href="yii-base-model.html#EVENT_AFTER_VALIDATE-detail">EVENT_AFTER_VALIDATE</a>
will be raised by the corresponding methods.</p>
<p>Only the <a href="yii-db-baseactiverecord.html#$dirtyAttributes-detail">changed attribute values</a> will be inserted into database.</p>
<p>If the primary key  is null during insertion, it will be populated with the actual
value after insertion.</p>
<p>For example, to insert a customer record:</p>
<pre><code class="hljs php language-php"><span class="hljs-variable">$customer</span> = <span class="hljs-keyword">new</span> Customer();
<span class="hljs-variable">$customer</span>-&gt;name = <span class="hljs-variable">$name</span>;
<span class="hljs-variable">$customer</span>-&gt;email = <span class="hljs-variable">$email</span>;
<span class="hljs-variable">$customer</span>-&gt;insert();
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-mongodb-activerecord.html#insert()-detail">insert</a></strong> ( <span style="color: #0000BB">$runValidation&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span>, <span style="color: #0000BB">$attributes&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$runValidation</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether to perform validation before saving the record.
If the validation fails, the record will not be inserted into the collection.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attributes</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of attributes that need to be saved. Defaults to null,
meaning all attributes that are loaded will be saved.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the attributes are valid and the record is inserted successfully.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="http://www.php.net/class.exception">Exception</a></td>
                  <td class="param-desc-col"><p>in case insert failed.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="insertInternal()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#insertInternal()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L219" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L219" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        insertInternal()
        <span class="detail-header-tag small">
            protected                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong></strong></p>

        
        <p>See also <a href="yii-mongodb-activerecord.html#insert()-detail">yii\mongodb\ActiveRecord::insert()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">protected</span> <span class="signature-type">void</span> <strong><a href="yii-mongodb-activerecord.html#insertInternal()-detail">insertInternal</a></strong> ( <span style="color: #0000BB">$attributes&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attributes</span></td>
                  <td class="param-type-col"></td>
                  <td class="param-desc-col"></td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="primaryKey()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#primaryKey()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L142" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L142" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        primaryKey()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the primary key name(s) for this AR class.</strong></p>

        <p>The default implementation will return ['_id'].</p>
<p>Note that an array should be returned even for a collection with single primary key.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a>[]</span> <strong><a href="yii-mongodb-activerecord.html#primaryKey()-detail">primaryKey</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a>[]</td>
                  <td class="param-desc-col"><p>The primary keys of the associated Mongo collection.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="toArray()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#toArray()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L359" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L359" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        toArray()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Converts the model into an array.</strong></p>

        <p>This method will first identify which fields to be included in the resulting array by calling <a href="yii-base-arrayabletrait.html#resolveFields()-detail">resolveFields()</a>.
It will then turn the model into an array with these fields. If <code>$recursive</code> is true,
any embedded objects will also be converted into arrays.</p>
<p>If the model implements the <span class="broken-link">\yii\mongodb\Linkable</span> interface, the resulting array will also have a <code>_link</code> element
which refers to a list of links as specified by the interface.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-mongodb-activerecord.html#toArray()-detail">toArray</a></strong> ( <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <span style="color: #0000BB">$fields&nbsp;</span><span style="color: #007700">=&nbsp;[]</span>, <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <span style="color: #0000BB">$expand&nbsp;</span><span style="color: #007700">=&nbsp;[]</span>, <span style="color: #0000BB">$recursive&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$fields</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The fields being requested. If empty, all fields as specified by <a href="yii-base-arrayabletrait.html#fields()-detail">fields()</a> will be returned.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$expand</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The additional fields being requested for exporting. Only fields declared in <a href="yii-base-arrayabletrait.html#extraFields()-detail">extraFields()</a>
will be considered.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$recursive</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether to recursively return array representation of embedded objects.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The array representation of the object</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="updateAll()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#updateAll()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L53" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L53" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        updateAll()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Updates all documents in the collection using the provided attribute values and conditions.</strong></p>

        <p>For example, to change the status to be 1 for all customers whose status is 2:</p>
<pre><code class="hljs php language-php">Customer::updateAll([<span class="hljs-string">'status'</span> =&gt; <span class="hljs-number">1</span>], [<span class="hljs-string">'status'</span> =&gt; <span class="hljs-number">2</span>]);
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="http://www.php.net/language.types.integer">integer</a></span> <strong><a href="yii-mongodb-activerecord.html#updateAll()-detail">updateAll</a></strong> ( <span style="color: #0000BB">$attributes</span>, <span style="color: #0000BB">$condition&nbsp;</span><span style="color: #007700">=&nbsp;[]</span>, <span style="color: #0000BB">$options&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attributes</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Attribute values (name-value pairs) to be saved into the collection</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$condition</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Description of the objects to update.
Please refer to <a href="yii-db-querytrait.html#where()-detail">yii\mongodb\Query::where()</a> on how to specify this parameter.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$options</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of options in format: optionName =&gt; optionValue.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>The number of documents updated.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="updateAllCounters()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#updateAllCounters()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L73" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L73" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        updateAllCounters()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Updates all documents in the collection using the provided counter changes and conditions.</strong></p>

        <p>For example, to increment all customers' age by 1,</p>
<pre><code class="hljs php language-php">Customer::updateAllCounters([<span class="hljs-string">'age'</span> =&gt; <span class="hljs-number">1</span>]);
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="http://www.php.net/language.types.integer">integer</a></span> <strong><a href="yii-mongodb-activerecord.html#updateAllCounters()-detail">updateAllCounters</a></strong> ( <span style="color: #0000BB">$counters</span>, <span style="color: #0000BB">$condition&nbsp;</span><span style="color: #007700">=&nbsp;[]</span>, <span style="color: #0000BB">$options&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$counters</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The counters to be updated (attribute name =&gt; increment value).
Use negative values if you want to decrement the counters.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$condition</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Description of the objects to update.
Please refer to <a href="yii-db-querytrait.html#where()-detail">yii\mongodb\Query::where()</a> on how to specify this parameter.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$options</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of options in format: optionName =&gt; optionValue.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>The number of documents updated.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="updateInternal()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-activerecord.html#updateInternal()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/ActiveRecord.php#L248" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveRecord.php#L248" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        updateInternal()
        <span class="detail-header-tag small">
            protected                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong></strong></p>

        
        <p>See also <a href="yii-db-activerecordinterface.html#update()-detail">yii\mongodb\ActiveRecord::update()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">protected</span> <span class="signature-type">void</span> <strong><a href="yii-mongodb-activerecord.html#updateInternal()-detail">updateInternal</a></strong> ( <span style="color: #0000BB">$attributes&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attributes</span></td>
                  <td class="param-type-col"></td>
                  <td class="param-desc-col"></td>
                </tr>
                                                    <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-db-staleobjectexception.html">yii\db\StaleObjectException</a></td>
                  <td class="param-desc-col"></td>
                </tr>
                        </table>

<!--	-->
</div>
        </div>
</div>

<script type="text/javascript">
    /*<![CDATA[*/
    $("a.toggle").on('click', function () {
        var $this = $(this);
        if ($this.hasClass('properties-hidden')) {
            $this.text($this.text().replace(/Show/,'Hide'));
            $this.parents(".summary").find(".inherited").show();
            $this.removeClass('properties-hidden');
        } else {
            $this.text($this.text().replace(/Hide/,'Show'));
            $this.parents(".summary").find(".inherited").hide();
            $this.addClass('properties-hidden');
        }

        return false;
    });
    /*
     $(".sourceCode a.show").toggle(function () {
     $(this).text($(this).text().replace(/show/,'hide'));
     $(this).parents(".sourceCode").find("div.code").show();
     },function () {
     $(this).text($(this).text().replace(/hide/,'show'));
     $(this).parents(".sourceCode").find("div.code").hide();
     });
     $("a.sourceLink").click(function () {
     $(this).attr('target','_blank');
     });
     */
    /*]]>*/
</script>


</div>

<footer class="footer">
        <p class="pull-right"><small>Page generated on Sat, 09 Jul 2016 12:15:57 +0000</small></p>
    Powered by <a href="http://www.yiiframework.com/" rel="external">Yii Framework</a></footer>

<script type="text/javascript">jQuery(document).ready(function () {
    var shiftWindow = function () { scrollBy(0, -50) };
    if (location.hash) setTimeout(shiftWindow, 1);
    window.addEventListener("hashchange", shiftWindow);
var element = document.createElement("script");
element.src = "./jssearch.index.js";
document.body.appendChild(element);

var searchBox = $('#searchbox');

// search when typing in search field
searchBox.on("keyup", function(event) {
    var query = $(this).val();

    if (query == '' || event.which == 27) {
        $('#search-resultbox').hide();
        return;
    } else if (event.which == 13) {
        var selectedLink = $('#search-resultbox a.selected');
        if (selectedLink.length != 0) {
            document.location = selectedLink.attr('href');
            return;
        }
    } else if (event.which == 38 || event.which == 40) {
        $('#search-resultbox').show();

        var selected = $('#search-resultbox a.selected');
        if (selected.length == 0) {
            $('#search-results').find('a').first().addClass('selected');
        } else {
            var next;
            if (event.which == 40) {
                next = selected.parent().next().find('a').first();
            } else {
                next = selected.parent().prev().find('a').first();
            }
            if (next.length != 0) {
                var resultbox = $('#search-results');
                var position = next.position();

//              TODO scrolling is buggy and jumps around
//                resultbox.scrollTop(Math.floor(position.top));
//                console.log(position.top);

                selected.removeClass('selected');
                next.addClass('selected');
            }
        }

        return;
    }
    $('#search-resultbox').show();
    $('#search-results').html('<li><span class="no-results">No results</span></li>');

    var result = jssearch.search(query);

    if (result.length > 0) {
        var i = 0;
        var resHtml = '';

        for (var key in result) {
            if (i++ > 20) {
                break;
            }
            resHtml = resHtml +
            '<li><a href="' + result[key].file.u.substr(3) +'"><span class="title">' + result[key].file.t + '</span>' +
            '<span class="description">' + result[key].file.d + '</span></a></li>';
        }
        $('#search-results').html(resHtml);
    }
});

// hide the search results on ESC
$(document).on("keyup", function(event) { if (event.which == 27) { $('#search-resultbox').hide(); } });
// hide search results on click to document
$(document).bind('click', function (e) { $('#search-resultbox').hide(); });
// except the following:
searchBox.bind('click', function(e) { e.stopPropagation(); });
$('#search-resultbox').bind('click', function(e) { e.stopPropagation(); });

});</script></body>
</html>
